home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DOC.ZIP / MENU.DOC < prev    next >
Text File  |  1991-11-20  |  4KB  |  98 lines

  1. MENU.DOC        11/20/91        Copyright (c) 1991 by James S. Clark
  2. ==========================================================================
  3. MENU
  4. Menu Class
  5. --------------------------------------------------------------------------
  6. Class Name                      Menu
  7. Superclass                      <none>
  8. Category                        Desktop
  9. Other classes referenced        Window
  10. Other catagories referenced     <none>
  11. Used by                         many
  12. Inherited by                    MenuBar
  13. Maturity index                  low
  14.  
  15. Declaration                     Menu    *menu = new Menu("title", x, y,
  16.                                                         flags, string, color );
  17. Instance Variables
  18.                                 Window  *owner;
  19.                                 int     id;
  20.                                 int     x, y;
  21.                                 int     type;
  22.                                 int     flag;
  23.                                 int     width;
  24.                                 int     numitems;
  25.                                 char    key[25];
  26.                                 char    *itemlist;
  27.                                 colors  *color;
  28. Instance Methods
  29.                                 Menu    ()      {};
  30.                                 Menu    (char *title, int nx, int ny,
  31.                                         int flags, char *str, colors *clr);
  32.                                 int     close   ();
  33.                                 int     select  ();
  34. --------------------------------------------------------------------------
  35. GENERAL DESCRIPTION
  36.  
  37. The Menu Class provides a very simple way of displaying a windowed menu
  38. on the text screen.  Methods are included to create and delete menus,
  39. and to allow menu item selecting.  Each time select() is called, it
  40. returns the number of the item that was selected.  Close() removes the
  41. menu from the screen and destroys it.
  42.  
  43. --------------------------------------------------------------------------
  44. VARIABLES       (all private)
  45.  
  46. Window  *owner;
  47.         The window that the menu is located in.
  48.  
  49. int     id;
  50.         The menu's ID number.
  51.  
  52. int     x, y;
  53.         The upper left coordinate of the menu window.
  54.  
  55. int     type;
  56.         The menu type.  (0-pop-up, 1-bar)
  57.  
  58. int     flag;
  59.         The menu's window flags.
  60.  
  61. int     width;
  62.         The width of the menu in characters.
  63.  
  64. int     numitems;
  65.         The number of items in the menu item list.
  66.  
  67. char    key[25];
  68.         The hot key letter of the menu items (maximum of 25)
  69.  
  70. char    *itemlist;
  71.         The formatted menu item string.
  72.  
  73. colors  *color;
  74.         The color set used to drae the menu.
  75.  
  76. --------------------------------------------------------------------------
  77. METHODS
  78.  
  79. Menu    (char *title, int nx, int ny, int flags, char *str, colors *clr);
  80.         Creates a new menu and displays it on the screen.  The formatted
  81.         menu string contains '>' signs at the head of each item.  The
  82.         menu is automatically size to accomidate the items specified.
  83.  
  84. ~Menu    ();
  85.         This closes the menu and removes it from the screen.
  86.  
  87. int     close   ();
  88.         This closes the menu and removes it from the screen.
  89.  
  90. int     select  ();
  91.         This allows the user to make a selection from the menu, using the
  92.         arrow keys to position, the enter key to select, or the escape key
  93.         to abort.  Returns with the item number selected or -1 for abort.
  94.  
  95. --------------------------------------------------------------------------
  96. MENU.DOC                        Copyright (c) 1991 by James S. Clark
  97. ==========================================================================
  98.